Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code for Numbers of Islands in C++ #629

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yuvrajsingh08
Copy link

Added a code for problem statement Number of islands ( leetcode 200) in C++ using BFS traversal.

Approach to solve the problem
1)Check 4 directions from each place
2)If we find "1" and the place is not visited yet, keep it.
This algorithm will visit all "1" places with one BFS operation if the places are connected in the same island, that means every time we start new BFS operation, the place is one of new islands.

Added a code for problem statement Number of islands ( leetcode 200) in C++.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant